.class public Lcom/netease/newsreader/util/PicUtil;
.super Ljava/lang/Object;
.source "PicUtil.java"


# static fields
.field public static photodownDir:Ljava/lang/String;

.field public static phototempDir:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 31
    const-string v0, "/sdcard/netease/newsreader/netease_temp_pic/"

    sput-object v0, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    .line 32
    const-string v0, "/sdcard/netease/newsreader/netease_down_pic/"

    sput-object v0, Lcom/netease/newsreader/util/PicUtil;->photodownDir:Ljava/lang/String;

    .line 29
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 29
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static changeDrawableFromBitMap(Landroid/graphics/Bitmap;)Landroid/graphics/drawable/Drawable;
    .locals 1
    .parameter "b"

    .prologue
    .line 340
    new-instance v0, Landroid/graphics/drawable/BitmapDrawable;

    invoke-direct {v0, p0}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    .line 341
    .local v0, drawable:Landroid/graphics/drawable/Drawable;
    return-object v0
.end method

.method public static createPhotoTempFolder()Z
    .locals 6

    .prologue
    const/4 v2, 0x1

    const/4 v3, 0x0

    .line 35
    new-instance v1, Ljava/io/File;

    sget-object v4, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-direct {v1, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 36
    .local v1, file:Ljava/io/File;
    new-instance v0, Ljava/io/File;

    new-instance v4, Ljava/lang/StringBuilder;

    sget-object v5, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v5, ".nomedia"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v0, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 37
    .local v0, f:Ljava/io/File;
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v4

    if-nez v4, :cond_0

    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMountedReadOnly()Z

    move-result v4

    if-eqz v4, :cond_3

    :cond_0
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v4

    if-eqz v4, :cond_3

    .line 38
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v3

    if-eqz v3, :cond_1

    invoke-virtual {v0}, Ljava/io/File;->isDirectory()Z

    move-result v3

    if-nez v3, :cond_2

    .line 39
    :cond_1
    invoke-virtual {v0}, Ljava/io/File;->mkdir()Z

    .line 51
    :cond_2
    :goto_0
    return v2

    .line 44
    :cond_3
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v4

    if-eqz v4, :cond_5

    .line 45
    invoke-virtual {v1}, Ljava/io/File;->mkdirs()Z

    move-result v4

    if-eqz v4, :cond_4

    .line 46
    invoke-virtual {v0}, Ljava/io/File;->mkdir()Z

    goto :goto_0

    :cond_4
    move v2, v3

    .line 49
    goto :goto_0

    :cond_5
    move v2, v3

    .line 51
    goto :goto_0
.end method

.method public static cutBitmap(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;
    .locals 6
    .parameter "src"
    .parameter "w"
    .parameter "h"

    .prologue
    const/4 v4, 0x0

    .line 244
    if-nez p0, :cond_0

    .line 245
    const/4 v0, 0x0

    .line 261
    :goto_0
    return-object v0

    .line 248
    :cond_0
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v2

    .line 249
    .local v2, imgW:I
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v1

    .line 251
    .local v1, imgH:I
    if-lt p1, v2, :cond_1

    move v3, v4

    .line 252
    .local v3, sx:I
    :goto_1
    if-lt p2, v1, :cond_2

    .line 254
    .local v4, sy:I
    :goto_2
    const/4 v0, 0x0

    .line 257
    .local v0, b:Landroid/graphics/Bitmap;
    if-nez v3, :cond_3

    .end local v2           #imgW:I
    :goto_3
    if-nez v4, :cond_4

    .end local v1           #imgH:I
    :goto_4
    invoke-static {p0, v3, v4, v2, v1}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIII)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 261
    goto :goto_0

    .line 251
    .end local v0           #b:Landroid/graphics/Bitmap;
    .end local v3           #sx:I
    .end local v4           #sy:I
    .restart local v1       #imgH:I
    .restart local v2       #imgW:I
    :cond_1
    sub-int v5, v2, p1

    div-int/lit8 v3, v5, 0x2

    goto :goto_1

    .line 252
    .restart local v3       #sx:I
    :cond_2
    sub-int v5, v1, p2

    div-int/lit8 v4, v5, 0x2

    goto :goto_2

    .restart local v0       #b:Landroid/graphics/Bitmap;
    .restart local v4       #sy:I
    :cond_3
    move v2, p1

    .line 257
    goto :goto_3

    .end local v2           #imgW:I
    :cond_4
    move v1, p2

    goto :goto_4
.end method

.method public static cutBitmap4DetailPage(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;
    .locals 6
    .parameter "src"
    .parameter "w"
    .parameter "h"

    .prologue
    const/4 v4, 0x0

    .line 169
    if-nez p0, :cond_1

    .line 170
    const/4 v0, 0x0

    .line 185
    .end local p1
    .end local p2
    :cond_0
    :goto_0
    return-object v0

    .line 173
    .restart local p1
    .restart local p2
    :cond_1
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v2

    .line 174
    .local v2, imgW:I
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v1

    .line 176
    .local v1, imgH:I
    if-lt p1, v2, :cond_2

    move v3, v4

    .line 179
    .local v3, sx:I
    :goto_1
    if-le v2, p1, :cond_3

    .end local p1
    :goto_2
    if-le v1, p2, :cond_4

    .end local p2
    :goto_3
    invoke-static {p0, v3, v4, p1, p2}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIII)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 181
    .local v0, b:Landroid/graphics/Bitmap;
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->isRecycled()Z

    move-result v4

    if-nez v4, :cond_0

    if-eqz p0, :cond_0

    .line 182
    invoke-virtual {p0}, Landroid/graphics/Bitmap;->recycle()V

    .line 183
    const/4 p0, 0x0

    goto :goto_0

    .line 176
    .end local v0           #b:Landroid/graphics/Bitmap;
    .end local v3           #sx:I
    .restart local p1
    .restart local p2
    :cond_2
    sub-int v5, v2, p1

    div-int/lit8 v3, v5, 0x2

    goto :goto_1

    .restart local v3       #sx:I
    :cond_3
    move p1, v2

    .line 179
    goto :goto_2

    .end local p1
    :cond_4
    move p2, v1

    goto :goto_3
.end method

.method public static downloadBitmap(Ljava/lang/String;Landroid/graphics/Bitmap;)Z
    .locals 8
    .parameter "filename"
    .parameter "mBitmap"

    .prologue
    const/4 v5, 0x0

    .line 498
    const-string v4, ""

    .line 500
    .local v4, returnfilename:Ljava/lang/String;
    const-string v6, ".jpg"

    invoke-virtual {p0, v6}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v6

    if-eqz v6, :cond_2

    .line 501
    new-instance v6, Ljava/lang/StringBuilder;

    sget-object v7, Lcom/netease/newsreader/util/PicUtil;->photodownDir:Ljava/lang/String;

    invoke-static {v7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    .line 508
    :goto_0
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v6

    if-eqz v6, :cond_1

    .line 509
    invoke-static {}, Lcom/netease/newsreader/util/PicUtil;->createPhotoTempFolder()Z

    .line 511
    new-instance v2, Ljava/io/File;

    invoke-direct {v2, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 513
    .local v2, f:Ljava/io/File;
    :try_start_0
    invoke-virtual {v2}, Ljava/io/File;->exists()Z

    move-result v6

    if-eqz v6, :cond_0

    invoke-virtual {v2}, Ljava/io/File;->delete()Z

    .line 515
    :cond_0
    new-instance v0, Ljava/io/File;

    sget-object v6, Lcom/netease/newsreader/util/PicUtil;->photodownDir:Ljava/lang/String;

    invoke-direct {v0, v6}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 517
    .local v0, dir:Ljava/io/File;
    invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z

    .line 519
    invoke-virtual {v2}, Ljava/io/File;->createNewFile()Z

    .line 520
    const/4 v3, 0x0

    .line 521
    .local v3, fOut:Ljava/io/FileOutputStream;
    new-instance v3, Ljava/io/FileOutputStream;

    .end local v3           #fOut:Ljava/io/FileOutputStream;
    invoke-direct {v3, v2}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 523
    .restart local v3       #fOut:Ljava/io/FileOutputStream;
    sget-object v6, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v7, 0x50

    invoke-virtual {p1, v6, v7, v3}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    .line 525
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->flush()V

    .line 526
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 532
    const/4 v5, 0x1

    .line 533
    .end local v0           #dir:Ljava/io/File;
    .end local v2           #f:Ljava/io/File;
    .end local v3           #fOut:Ljava/io/FileOutputStream;
    :cond_1
    :goto_1
    return v5

    .line 503
    :cond_2
    new-instance v6, Ljava/lang/StringBuilder;

    sget-object v7, Lcom/netease/newsreader/util/PicUtil;->photodownDir:Ljava/lang/String;

    invoke-static {v7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, ".jpg"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    goto :goto_0

    .line 527
    .restart local v2       #f:Ljava/io/File;
    :catch_0
    move-exception v1

    .line 529
    .local v1, e:Ljava/lang/Exception;
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1
.end method

.method public static downloadImg4offline(Ljava/lang/String;Landroid/content/Context;)Z
    .locals 14
    .parameter "url"
    .parameter "mContext"

    .prologue
    .line 349
    if-eqz p0, :cond_0

    :try_start_0
    const-string v10, ""

    invoke-virtual {p0, v10}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v10

    if-eqz v10, :cond_1

    .line 350
    :cond_0
    const/4 v10, 0x0

    .line 410
    :goto_0
    return v10

    .line 352
    :cond_1
    new-instance v3, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v3}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    .line 354
    .local v3, httpParams:Lorg/apache/http/params/HttpParams;
    const/16 v10, 0x7530

    invoke-static {v3, v10}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 355
    const/16 v10, 0x7530

    invoke-static {v3, v10}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 356
    invoke-static {v3}, Lcom/netease/newsreader/util/NeteaseHttpClient;->getHttpClient(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/impl/client/DefaultHttpClient;

    move-result-object v2

    .line 357
    .local v2, httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    invoke-static {p1}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v10

    if-eqz v10, :cond_2

    .line 358
    new-instance v5, Lorg/apache/http/HttpHost;

    const-string v10, "10.0.0.172"

    const/16 v11, 0x50

    const-string v12, "http"

    invoke-direct {v5, v10, v11, v12}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V

    .line 359
    .local v5, proxy:Lorg/apache/http/HttpHost;
    invoke-virtual {v2}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v10

    const-string v11, "http.route.default-proxy"

    invoke-interface {v10, v11, v5}, Lorg/apache/http/params/HttpParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/http/params/HttpParams;

    .line 363
    .end local v5           #proxy:Lorg/apache/http/HttpHost;
    :goto_1
    new-instance v9, Ljava/lang/StringBuilder;

    invoke-direct {v9, p0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 364
    .local v9, smallurl:Ljava/lang/StringBuilder;
    const-string v10, "http://"

    invoke-virtual {v10}, Ljava/lang/String;->length()I

    move-result v10

    const-string v11, "s.cimg.163.com/i/"

    invoke-virtual {v9, v10, v11}, Ljava/lang/StringBuilder;->insert(ILjava/lang/String;)Ljava/lang/StringBuilder;

    .line 365
    const-string v10, ".220x220.auto.jpg"

    invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 368
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0, p0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 369
    .local v0, bigurl:Ljava/lang/StringBuilder;
    invoke-static {p1}, Lcom/netease/newsreader/util/Tools;->getScreenMetrics(Landroid/content/Context;)I

    move-result v8

    .line 370
    .local v8, screentype:I
    const-string v10, "http://"

    invoke-virtual {v10}, Ljava/lang/String;->length()I

    move-result v10

    const-string v11, "s.cimg.163.com/i/"

    invoke-virtual {v0, v10, v11}, Ljava/lang/StringBuilder;->insert(ILjava/lang/String;)Ljava/lang/StringBuilder;

    .line 371
    const/4 v10, 0x1

    if-ne v10, v8, :cond_3

    .line 372
    const-string v10, ".180x300.auto.jpg"

    invoke-virtual {v0, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 378
    :goto_2
    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    .line 379
    const-string v12, "/"

    invoke-virtual {v11, v12}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v11

    add-int/lit8 v11, v11, 0x1

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/String;->length()I

    move-result v12

    .line 378
    invoke-virtual {v10, v11, v12}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v10

    invoke-static {v10}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v10

    if-nez v10, :cond_6

    .line 380
    new-instance v6, Lorg/apache/http/client/methods/HttpGet;

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-direct {v6, v10}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 381
    .local v6, request:Lorg/apache/http/client/methods/HttpGet;
    invoke-virtual {v2, v6}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v7

    .line 382
    .local v7, response:Lorg/apache/http/HttpResponse;
    invoke-interface {v7}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v10

    invoke-interface {v10}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v4

    .line 383
    .local v4, is:Ljava/io/InputStream;
    if-nez v4, :cond_5

    .line 384
    const/4 v10, 0x0

    goto/16 :goto_0

    .line 361
    .end local v0           #bigurl:Ljava/lang/StringBuilder;
    .end local v4           #is:Ljava/io/InputStream;
    .end local v6           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v7           #response:Lorg/apache/http/HttpResponse;
    .end local v8           #screentype:I
    .end local v9           #smallurl:Ljava/lang/StringBuilder;
    :cond_2
    invoke-virtual {v2}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v10

    const-string v11, "http.route.default-proxy"

    invoke-interface {v10, v11}, Lorg/apache/http/params/HttpParams;->removeParameter(Ljava/lang/String;)Z

    goto :goto_1

    .line 408
    .end local v2           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v3           #httpParams:Lorg/apache/http/params/HttpParams;
    :catch_0
    move-exception v1

    .line 410
    .local v1, e:Ljava/lang/Exception;
    const/4 v10, 0x0

    goto/16 :goto_0

    .line 373
    .end local v1           #e:Ljava/lang/Exception;
    .restart local v0       #bigurl:Ljava/lang/StringBuilder;
    .restart local v2       #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v3       #httpParams:Lorg/apache/http/params/HttpParams;
    .restart local v8       #screentype:I
    .restart local v9       #smallurl:Ljava/lang/StringBuilder;
    :cond_3
    const/4 v10, 0x2

    if-ne v10, v8, :cond_4

    .line 374
    const-string v10, ".220x370.auto.jpg"

    invoke-virtual {v0, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_2

    .line 376
    :cond_4
    const-string v10, ".420x740.auto.jpg"

    invoke-virtual {v0, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_2

    .line 386
    .restart local v4       #is:Ljava/io/InputStream;
    .restart local v6       #request:Lorg/apache/http/client/methods/HttpGet;
    .restart local v7       #response:Lorg/apache/http/HttpResponse;
    :cond_5
    new-instance v10, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;

    invoke-direct {v10, v4}, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;-><init>(Ljava/io/InputStream;)V

    .line 387
    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    const-string v13, "/"

    invoke-virtual {v12, v13}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v12

    add-int/lit8 v12, v12, 0x1

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v13

    invoke-virtual {v13}, Ljava/lang/String;->length()I

    move-result v13

    invoke-virtual {v11, v12, v13}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v11

    .line 386
    invoke-static {v10, v11}, Lcom/netease/newsreader/util/PicUtil;->writeTempJPEGFile(Ljava/io/InputStream;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    .line 387
    const-string v11, ""

    invoke-virtual {v10, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    .line 389
    invoke-virtual {v4}, Ljava/io/InputStream;->close()V

    .line 391
    .end local v4           #is:Ljava/io/InputStream;
    .end local v6           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v7           #response:Lorg/apache/http/HttpResponse;
    :cond_6
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    .line 392
    const-string v12, "/"

    invoke-virtual {v11, v12}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v11

    add-int/lit8 v11, v11, 0x1

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    invoke-virtual {v12}, Ljava/lang/String;->length()I

    move-result v12

    .line 391
    invoke-virtual {v10, v11, v12}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v10

    invoke-static {v10}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v10

    if-nez v10, :cond_8

    .line 393
    new-instance v6, Lorg/apache/http/client/methods/HttpGet;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-direct {v6, v10}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 394
    .restart local v6       #request:Lorg/apache/http/client/methods/HttpGet;
    invoke-virtual {v2, v6}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v7

    .line 395
    .restart local v7       #response:Lorg/apache/http/HttpResponse;
    invoke-interface {v7}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v10

    invoke-interface {v10}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v4

    .line 396
    .restart local v4       #is:Ljava/io/InputStream;
    if-nez v4, :cond_7

    .line 397
    const/4 v10, 0x0

    goto/16 :goto_0

    .line 399
    :cond_7
    new-instance v10, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;

    invoke-direct {v10, v4}, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;-><init>(Ljava/io/InputStream;)V

    .line 400
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v12

    const-string v13, "/"

    invoke-virtual {v12, v13}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v12

    add-int/lit8 v12, v12, 0x1

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v13

    invoke-virtual {v13}, Ljava/lang/String;->length()I

    move-result v13

    invoke-virtual {v11, v12, v13}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v11

    .line 399
    invoke-static {v10, v11}, Lcom/netease/newsreader/util/PicUtil;->writeTempJPEGFile(Ljava/io/InputStream;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    .line 400
    const-string v11, ""

    invoke-virtual {v10, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    .line 402
    invoke-virtual {v4}, Ljava/io/InputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 407
    .end local v4           #is:Ljava/io/InputStream;
    .end local v6           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v7           #response:Lorg/apache/http/HttpResponse;
    :cond_8
    const/4 v10, 0x1

    goto/16 :goto_0
.end method

.method public static downloadImgToLocal(Ljava/lang/String;Landroid/content/Context;)Z
    .locals 11
    .parameter "url"
    .parameter "mContext"

    .prologue
    const/4 v7, 0x0

    .line 424
    if-eqz p0, :cond_0

    :try_start_0
    const-string v8, ""

    invoke-virtual {p0, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_1

    .line 451
    :cond_0
    :goto_0
    return v7

    .line 427
    :cond_1
    new-instance v2, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v2}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    .line 429
    .local v2, httpParams:Lorg/apache/http/params/HttpParams;
    const/16 v8, 0x7530

    invoke-static {v2, v8}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 430
    const/16 v8, 0x7530

    invoke-static {v2, v8}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 431
    invoke-static {v2}, Lcom/netease/newsreader/util/NeteaseHttpClient;->getHttpClient(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/impl/client/DefaultHttpClient;

    move-result-object v1

    .line 432
    .local v1, httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    invoke-static {p1}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v8

    if-eqz v8, :cond_2

    .line 433
    new-instance v4, Lorg/apache/http/HttpHost;

    const-string v8, "10.0.0.172"

    const/16 v9, 0x50

    const-string v10, "http"

    invoke-direct {v4, v8, v9, v10}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V

    .line 434
    .local v4, proxy:Lorg/apache/http/HttpHost;
    invoke-virtual {v1}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v8

    const-string v9, "http.route.default-proxy"

    invoke-interface {v8, v9, v4}, Lorg/apache/http/params/HttpParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/http/params/HttpParams;

    .line 438
    .end local v4           #proxy:Lorg/apache/http/HttpHost;
    :goto_1
    new-instance v5, Lorg/apache/http/client/methods/HttpGet;

    invoke-direct {v5, p0}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 439
    .local v5, request:Lorg/apache/http/client/methods/HttpGet;
    invoke-virtual {v1, v5}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v6

    .line 440
    .local v6, response:Lorg/apache/http/HttpResponse;
    invoke-interface {v6}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v8

    invoke-interface {v8}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v3

    .line 441
    .local v3, is:Ljava/io/InputStream;
    if-eqz v3, :cond_0

    .line 444
    new-instance v8, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;

    invoke-direct {v8, v3}, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;-><init>(Ljava/io/InputStream;)V

    .line 445
    const-string v9, "/"

    invoke-virtual {p0, v9}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v9

    add-int/lit8 v9, v9, 0x1

    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v10

    invoke-virtual {p0, v9, v10}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v9

    .line 444
    invoke-static {v8, v9}, Lcom/netease/newsreader/util/PicUtil;->writeTempJPEGFile(Ljava/io/InputStream;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    .line 445
    const-string v9, ""

    invoke-virtual {v8, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    .line 447
    invoke-virtual {v3}, Ljava/io/InputStream;->close()V

    .line 448
    const/4 v7, 0x1

    goto :goto_0

    .line 436
    .end local v3           #is:Ljava/io/InputStream;
    .end local v5           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v6           #response:Lorg/apache/http/HttpResponse;
    :cond_2
    invoke-virtual {v1}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v8

    const-string v9, "http.route.default-proxy"

    invoke-interface {v8, v9}, Lorg/apache/http/params/HttpParams;->removeParameter(Ljava/lang/String;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    .line 449
    .end local v1           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v2           #httpParams:Lorg/apache/http/params/HttpParams;
    :catch_0
    move-exception v0

    .line 451
    .local v0, e:Ljava/lang/Exception;
    goto :goto_0
.end method

.method public static downloadImgToLocal(Ljava/lang/String;Ljava/lang/String;Landroid/content/Context;)Z
    .locals 11
    .parameter "path"
    .parameter "url"
    .parameter "mContext"

    .prologue
    const/4 v7, 0x0

    .line 463
    if-eqz p1, :cond_0

    :try_start_0
    const-string v8, ""

    invoke-virtual {p1, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_1

    .line 490
    :cond_0
    :goto_0
    return v7

    .line 466
    :cond_1
    new-instance v2, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v2}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    .line 468
    .local v2, httpParams:Lorg/apache/http/params/HttpParams;
    const/16 v8, 0x7530

    invoke-static {v2, v8}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 469
    const/16 v8, 0x7530

    invoke-static {v2, v8}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 470
    invoke-static {v2}, Lcom/netease/newsreader/util/NeteaseHttpClient;->getHttpClient(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/impl/client/DefaultHttpClient;

    move-result-object v1

    .line 471
    .local v1, httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    invoke-static {p2}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v8

    if-eqz v8, :cond_2

    .line 472
    new-instance v4, Lorg/apache/http/HttpHost;

    const-string v8, "10.0.0.172"

    const/16 v9, 0x50

    const-string v10, "http"

    invoke-direct {v4, v8, v9, v10}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V

    .line 473
    .local v4, proxy:Lorg/apache/http/HttpHost;
    invoke-virtual {v1}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v8

    const-string v9, "http.route.default-proxy"

    invoke-interface {v8, v9, v4}, Lorg/apache/http/params/HttpParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/http/params/HttpParams;

    .line 477
    .end local v4           #proxy:Lorg/apache/http/HttpHost;
    :goto_1
    new-instance v5, Lorg/apache/http/client/methods/HttpGet;

    invoke-direct {v5, p1}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 478
    .local v5, request:Lorg/apache/http/client/methods/HttpGet;
    invoke-virtual {v1, v5}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v6

    .line 479
    .local v6, response:Lorg/apache/http/HttpResponse;
    invoke-interface {v6}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v8

    invoke-interface {v8}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v3

    .line 480
    .local v3, is:Ljava/io/InputStream;
    if-eqz v3, :cond_0

    .line 483
    new-instance v8, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;

    invoke-direct {v8, v3}, Lcom/netease/newsreader/util/BaseImageDownloader$FlushedInputStream;-><init>(Ljava/io/InputStream;)V

    .line 484
    const-string v9, "/"

    invoke-virtual {p1, v9}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v9

    add-int/lit8 v9, v9, 0x1

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v10

    invoke-virtual {p1, v9, v10}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v9

    .line 483
    invoke-static {p0, v8, v9}, Lcom/netease/newsreader/util/PicUtil;->writeLocalJPEGFile(Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    .line 484
    const-string v9, ""

    invoke-virtual {v8, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    .line 486
    invoke-virtual {v3}, Ljava/io/InputStream;->close()V

    .line 487
    const/4 v7, 0x1

    goto :goto_0

    .line 475
    .end local v3           #is:Ljava/io/InputStream;
    .end local v5           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v6           #response:Lorg/apache/http/HttpResponse;
    :cond_2
    invoke-virtual {v1}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v8

    const-string v9, "http.route.default-proxy"

    invoke-interface {v8, v9}, Lorg/apache/http/params/HttpParams;->removeParameter(Ljava/lang/String;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    .line 488
    .end local v1           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v2           #httpParams:Lorg/apache/http/params/HttpParams;
    :catch_0
    move-exception v0

    .line 490
    .local v0, e:Ljava/lang/Exception;
    goto :goto_0
.end method

.method public static fitSizeImg(Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 8
    .parameter "path"

    .prologue
    const/4 v5, 0x0

    const/4 v7, 0x1

    .line 865
    new-instance v4, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v4}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 866
    .local v4, opt:Landroid/graphics/BitmapFactory$Options;
    sget-object v6, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    iput-object v6, v4, Landroid/graphics/BitmapFactory$Options;->inPreferredConfig:Landroid/graphics/Bitmap$Config;

    .line 867
    iput-boolean v7, v4, Landroid/graphics/BitmapFactory$Options;->inPurgeable:Z

    .line 868
    iput-boolean v7, v4, Landroid/graphics/BitmapFactory$Options;->inInputShareable:Z

    .line 869
    new-instance v2, Ljava/io/File;

    invoke-direct {v2, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 871
    .local v2, file:Ljava/io/File;
    :try_start_0
    new-instance v3, Ljava/io/FileInputStream;

    invoke-direct {v3, v2}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    .line 872
    .local v3, i:Ljava/io/InputStream;
    const/4 v6, 0x0

    invoke-static {v3, v6, v4}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 873
    .local v0, bitmap:Landroid/graphics/Bitmap;
    if-nez v0, :cond_0

    .line 874
    invoke-virtual {v2}, Ljava/io/File;->exists()Z

    move-result v6

    if-eqz v6, :cond_0

    .line 875
    invoke-virtual {v2}, Ljava/io/File;->delete()Z
    :try_end_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 888
    .end local v0           #bitmap:Landroid/graphics/Bitmap;
    .end local v3           #i:Ljava/io/InputStream;
    :cond_0
    :goto_0
    return-object v0

    .line 879
    :catch_0
    move-exception v1

    .line 880
    .local v1, e:Ljava/lang/OutOfMemoryError;
    invoke-virtual {v1}, Ljava/lang/OutOfMemoryError;->printStackTrace()V

    .line 885
    .end local v1           #e:Ljava/lang/OutOfMemoryError;
    :goto_1
    invoke-virtual {v2}, Ljava/io/File;->exists()Z

    move-result v6

    if-eqz v6, :cond_1

    .line 886
    invoke-virtual {v2}, Ljava/io/File;->delete()Z

    :cond_1
    move-object v0, v5

    .line 888
    goto :goto_0

    .line 881
    :catch_1
    move-exception v1

    .line 883
    .local v1, e:Ljava/lang/Exception;
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1
.end method

.method public static get3G_PhotoResize(Ljava/lang/String;II)Ljava/lang/String;
    .locals 4
    .parameter "url"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 846
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    .line 847
    .local v0, imgUrl:Ljava/lang/StringBuilder;
    move-object v1, p0

    .line 848
    .local v1, urlString:Ljava/lang/String;
    const-string v2, "http://"

    sget-object v3, Lcom/netease/newsreader/util/StringUtil;->imageResize_Url:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 849
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "."

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "x"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, ".auto.jpg"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 850
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    return-object v2
.end method

.method public static get3gImgurl(Ljava/lang/String;II)Ljava/lang/String;
    .locals 4
    .parameter "orgurl"
    .parameter "width"
    .parameter "length"

    .prologue
    .line 58
    const-string v0, "http://s.cimg.163.com/i/"

    .line 59
    .local v0, url:Ljava/lang/String;
    const-string v1, "http://"

    invoke-virtual {p0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 60
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v2, "http://"

    const-string v3, ""

    invoke-virtual {p0, v2, v3}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "."

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "x"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ".auto.jpg"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 65
    :goto_0
    return-object v0

    .line 62
    :cond_0
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "."

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "x"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ".auto.jpg"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method public static getBitMapForStringURL(Ljava/lang/String;Landroid/content/Context;)Landroid/graphics/Bitmap;
    .locals 10
    .parameter "urlString"
    .parameter "mContext"

    .prologue
    .line 307
    const/4 v0, 0x0

    .line 311
    .local v0, bitmap:Landroid/graphics/Bitmap;
    :try_start_0
    new-instance v2, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v2}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    .line 313
    .local v2, httpParams:Lorg/apache/http/params/HttpParams;
    const/16 v7, 0x7530

    invoke-static {v2, v7}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 314
    const/16 v7, 0x7530

    invoke-static {v2, v7}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 315
    invoke-static {v2}, Lcom/netease/newsreader/util/NeteaseHttpClient;->getHttpClient(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/impl/client/DefaultHttpClient;

    move-result-object v1

    .line 316
    .local v1, httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    invoke-static {p1}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v7

    if-eqz v7, :cond_0

    .line 317
    new-instance v4, Lorg/apache/http/HttpHost;

    const-string v7, "10.0.0.172"

    const/16 v8, 0x50

    const-string v9, "http"

    invoke-direct {v4, v7, v8, v9}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V

    .line 318
    .local v4, proxy:Lorg/apache/http/HttpHost;
    invoke-virtual {v1}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v7

    const-string v8, "http.route.default-proxy"

    invoke-interface {v7, v8, v4}, Lorg/apache/http/params/HttpParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/http/params/HttpParams;

    .line 323
    .end local v4           #proxy:Lorg/apache/http/HttpHost;
    :goto_0
    new-instance v5, Lorg/apache/http/client/methods/HttpGet;

    invoke-direct {v5, p0}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 324
    .local v5, request:Lorg/apache/http/client/methods/HttpGet;
    invoke-virtual {v1, v5}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v6

    .line 325
    .local v6, response:Lorg/apache/http/HttpResponse;
    invoke-interface {v6}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v7

    invoke-interface {v7}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v3

    .line 327
    .local v3, is:Ljava/io/InputStream;
    invoke-static {v3}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 329
    invoke-virtual {v3}, Ljava/io/InputStream;->close()V

    .line 336
    .end local v1           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v2           #httpParams:Lorg/apache/http/params/HttpParams;
    .end local v3           #is:Ljava/io/InputStream;
    .end local v5           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v6           #response:Lorg/apache/http/HttpResponse;
    :goto_1
    return-object v0

    .line 320
    .restart local v1       #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v2       #httpParams:Lorg/apache/http/params/HttpParams;
    :cond_0
    invoke-virtual {v1}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v7

    const-string v8, "http.route.default-proxy"

    invoke-interface {v7, v8}, Lorg/apache/http/params/HttpParams;->removeParameter(Ljava/lang/String;)Z
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_1

    goto :goto_0

    .line 331
    .end local v1           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v2           #httpParams:Lorg/apache/http/params/HttpParams;
    :catch_0
    move-exception v7

    goto :goto_1

    .line 333
    :catch_1
    move-exception v7

    goto :goto_1
.end method

.method public static getCoverUrl(Ljava/lang/String;Landroid/content/Context;)Ljava/lang/String;
    .locals 5
    .parameter "urlString"
    .parameter "c"

    .prologue
    .line 854
    invoke-static {p1}, Lcom/netease/newsreader/util/Tools;->getWidth_Height(Landroid/content/Context;)Ljava/util/HashMap;

    move-result-object v1

    .line 855
    .local v1, m:Ljava/util/HashMap;,"Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Integer;>;"
    const-string v4, "w"

    invoke-virtual {v1, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/Integer;

    invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

    move-result v3

    .line 856
    .local v3, width:I
    const-string v4, "h"

    invoke-virtual {v1, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/Integer;

    invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

    move-result v0

    .line 857
    .local v0, height:I
    move-object v2, p0

    .line 859
    .local v2, rst:Ljava/lang/String;
    invoke-static {p0, v3, v0}, Lcom/netease/newsreader/util/PicUtil;->get3G_PhotoResize(Ljava/lang/String;II)Ljava/lang/String;

    move-result-object v2

    .line 860
    return-object v2
.end method

.method public static getHeandBitMapURL(Ljava/lang/String;Landroid/content/Context;)Ljava/lang/String;
    .locals 5
    .parameter "urlString"
    .parameter "c"

    .prologue
    .line 833
    invoke-static {p1}, Lcom/netease/newsreader/util/Tools;->getScreenWidth(Landroid/content/Context;)I

    move-result v2

    .line 834
    .local v2, width:I
    invoke-static {v2}, Lcom/netease/newsreader/util/Tools;->getHeadPicHeight(I)I

    move-result v0

    .line 835
    .local v0, height:I
    move-object v1, p0

    .line 837
    .local v1, rst:Ljava/lang/String;
    invoke-static {p0, v2, v0}, Lcom/netease/newsreader/util/PicUtil;->get3G_PhotoResize(Ljava/lang/String;II)Ljava/lang/String;

    move-result-object v1

    .line 838
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "getHeandBitMapURL:"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/netease/newsreader/util/Logger;->i(Ljava/lang/String;)V

    .line 839
    return-object v1
.end method

.method public static getPicturefromUrl(Ljava/lang/String;Landroid/content/Context;Z)Landroid/graphics/drawable/Drawable;
    .locals 14
    .parameter "url"
    .parameter "mContext"
    .parameter "isshowimg"

    .prologue
    .line 265
    const/4 v1, 0x0

    .line 268
    .local v1, d:Landroid/graphics/drawable/Drawable;
    if-eqz p2, :cond_0

    .line 269
    :try_start_0
    new-instance v6, Lorg/apache/http/params/BasicHttpParams;

    invoke-direct {v6}, Lorg/apache/http/params/BasicHttpParams;-><init>()V

    .line 271
    .local v6, httpParams:Lorg/apache/http/params/HttpParams;
    const/16 v11, 0x7530

    invoke-static {v6, v11}, Lorg/apache/http/params/HttpConnectionParams;->setConnectionTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 272
    const/16 v11, 0x7530

    invoke-static {v6, v11}, Lorg/apache/http/params/HttpConnectionParams;->setSoTimeout(Lorg/apache/http/params/HttpParams;I)V

    .line 273
    invoke-static {v6}, Lcom/netease/newsreader/util/NeteaseHttpClient;->getHttpClient(Lorg/apache/http/params/HttpParams;)Lorg/apache/http/impl/client/DefaultHttpClient;

    move-result-object v5

    .line 274
    .local v5, httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    invoke-static {p1}, Lcom/netease/newsreader/util/Tools;->isCMWAPMobileNet(Landroid/content/Context;)Z

    move-result v11

    if-eqz v11, :cond_1

    .line 275
    new-instance v8, Lorg/apache/http/HttpHost;

    const-string v11, "10.0.0.172"

    const/16 v12, 0x50

    const-string v13, "http"

    invoke-direct {v8, v11, v12, v13}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V

    .line 276
    .local v8, proxy:Lorg/apache/http/HttpHost;
    invoke-virtual {v5}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v11

    const-string v12, "http.route.default-proxy"

    invoke-interface {v11, v12, v8}, Lorg/apache/http/params/HttpParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)Lorg/apache/http/params/HttpParams;

    .line 281
    .end local v8           #proxy:Lorg/apache/http/HttpHost;
    :goto_0
    const-string v11, "getPicturefromUrl"

    invoke-static {v11, p0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 282
    new-instance v9, Lorg/apache/http/client/methods/HttpGet;

    invoke-direct {v9, p0}, Lorg/apache/http/client/methods/HttpGet;-><init>(Ljava/lang/String;)V

    .line 283
    .local v9, request:Lorg/apache/http/client/methods/HttpGet;
    invoke-virtual {v5, v9}, Lorg/apache/http/impl/client/DefaultHttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v10

    .line 284
    .local v10, response:Lorg/apache/http/HttpResponse;
    invoke-interface {v10}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v11

    invoke-interface {v11}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v7

    .line 287
    .local v7, is:Ljava/io/InputStream;
    invoke-static {v7}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 288
    .local v0, b:Landroid/graphics/Bitmap;
    new-instance v2, Landroid/graphics/drawable/BitmapDrawable;

    invoke-direct {v2, v0}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V
    :try_end_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 289
    .end local v1           #d:Landroid/graphics/drawable/Drawable;
    .local v2, d:Landroid/graphics/drawable/Drawable;
    :try_start_1
    invoke-virtual {v7}, Ljava/io/InputStream;->close()V
    :try_end_1
    .catch Ljava/lang/OutOfMemoryError; {:try_start_1 .. :try_end_1} :catch_3
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2

    move-object v1, v2

    .end local v0           #b:Landroid/graphics/Bitmap;
    .end local v2           #d:Landroid/graphics/drawable/Drawable;
    .end local v5           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v6           #httpParams:Lorg/apache/http/params/HttpParams;
    .end local v7           #is:Ljava/io/InputStream;
    .end local v9           #request:Lorg/apache/http/client/methods/HttpGet;
    .end local v10           #response:Lorg/apache/http/HttpResponse;
    .restart local v1       #d:Landroid/graphics/drawable/Drawable;
    :cond_0
    move-object v11, v1

    .line 300
    :goto_1
    return-object v11

    .line 278
    .restart local v5       #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v6       #httpParams:Lorg/apache/http/params/HttpParams;
    :cond_1
    :try_start_2
    invoke-virtual {v5}, Lorg/apache/http/impl/client/DefaultHttpClient;->getParams()Lorg/apache/http/params/HttpParams;

    move-result-object v11

    const-string v12, "http.route.default-proxy"

    invoke-interface {v11, v12}, Lorg/apache/http/params/HttpParams;->removeParameter(Ljava/lang/String;)Z
    :try_end_2
    .catch Ljava/lang/OutOfMemoryError; {:try_start_2 .. :try_end_2} :catch_0
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_0

    .line 296
    .end local v5           #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .end local v6           #httpParams:Lorg/apache/http/params/HttpParams;
    :catch_0
    move-exception v4

    .line 297
    .local v4, error:Ljava/lang/OutOfMemoryError;
    :goto_2
    const/4 v11, 0x0

    goto :goto_1

    .line 298
    .end local v4           #error:Ljava/lang/OutOfMemoryError;
    :catch_1
    move-exception v3

    .line 300
    .local v3, e:Ljava/lang/Exception;
    :goto_3
    const/4 v11, 0x0

    goto :goto_1

    .line 298
    .end local v1           #d:Landroid/graphics/drawable/Drawable;
    .end local v3           #e:Ljava/lang/Exception;
    .restart local v0       #b:Landroid/graphics/Bitmap;
    .restart local v2       #d:Landroid/graphics/drawable/Drawable;
    .restart local v5       #httpClient:Lorg/apache/http/impl/client/DefaultHttpClient;
    .restart local v6       #httpParams:Lorg/apache/http/params/HttpParams;
    .restart local v7       #is:Ljava/io/InputStream;
    .restart local v9       #request:Lorg/apache/http/client/methods/HttpGet;
    .restart local v10       #response:Lorg/apache/http/HttpResponse;
    :catch_2
    move-exception v3

    move-object v1, v2

    .end local v2           #d:Landroid/graphics/drawable/Drawable;
    .restart local v1       #d:Landroid/graphics/drawable/Drawable;
    goto :goto_3

    .line 296
    .end local v1           #d:Landroid/graphics/drawable/Drawable;
    .restart local v2       #d:Landroid/graphics/drawable/Drawable;
    :catch_3
    move-exception v4

    move-object v1, v2

    .end local v2           #d:Landroid/graphics/drawable/Drawable;
    .restart local v1       #d:Landroid/graphics/drawable/Drawable;
    goto :goto_2
.end method

.method public static getTempJPEGFile(Ljava/lang/String;)Ljava/lang/String;
    .locals 3
    .parameter "filename"

    .prologue
    .line 625
    const-string v0, ""

    .line 626
    .local v0, imageName:Ljava/lang/String;
    const-string v1, ".jpg"

    invoke-virtual {p0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 627
    new-instance v1, Ljava/lang/StringBuilder;

    sget-object v2, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 631
    :goto_0
    return-object v0

    .line 629
    :cond_0
    new-instance v1, Ljava/lang/StringBuilder;

    sget-object v2, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ".jpg"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method public static isLocalPicExit(Ljava/lang/String;)Z
    .locals 3
    .parameter "picname"

    .prologue
    .line 806
    const-string v0, ""

    .line 807
    .local v0, picpath:Ljava/lang/String;
    const-string v1, ".jpg"

    invoke-virtual {p0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 808
    new-instance v1, Ljava/lang/StringBuilder;

    sget-object v2, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 812
    :goto_0
    invoke-static {v0}, Lcom/netease/newsreader/util/FileUtils;->isFileExit(Ljava/lang/String;)Z

    move-result v1

    return v1

    .line 809
    :cond_0
    new-instance v1, Ljava/lang/StringBuilder;

    sget-object v2, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ".jpg"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method public static isLocalPicExit(Ljava/lang/String;Ljava/lang/String;)Z
    .locals 3
    .parameter "path"
    .parameter "picname"

    .prologue
    .line 816
    const-string v0, ""

    .line 817
    .local v0, picpath:Ljava/lang/String;
    const-string v1, ".jpg"

    invoke-virtual {p1, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 818
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 822
    :goto_0
    invoke-static {v0}, Lcom/netease/newsreader/util/FileUtils;->isFileExit(Ljava/lang/String;)Z

    move-result v1

    return v1

    .line 819
    :cond_0
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ".jpg"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method public static readLocalJPEGFile(Ljava/lang/String;Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 3
    .parameter "path"
    .parameter "picname"

    .prologue
    .line 795
    const-string v0, ""

    .line 796
    .local v0, picpath:Ljava/lang/String;
    const-string v1, ".jpg"

    invoke-virtual {p1, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 797
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 800
    :goto_0
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v1

    if-nez v1, :cond_0

    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMountedReadOnly()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 801
    :cond_0
    invoke-static {v0}, Lcom/netease/newsreader/util/PicUtil;->fitSizeImg(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v1

    .line 802
    :goto_1
    return-object v1

    .line 798
    :cond_1
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ".jpg"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    .line 802
    :cond_2
    const/4 v1, 0x0

    goto :goto_1
.end method

.method public static readTempJPEGFile(Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 3
    .parameter "picname"

    .prologue
    .line 783
    const-string v0, ""

    .line 784
    .local v0, picpath:Ljava/lang/String;
    const-string v1, ".jpg"

    invoke-virtual {p0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 785
    new-instance v1, Ljava/lang/StringBuilder;

    sget-object v2, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 788
    :goto_0
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v1

    if-nez v1, :cond_0

    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMountedReadOnly()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 789
    :cond_0
    invoke-static {v0}, Lcom/netease/newsreader/util/PicUtil;->fitSizeImg(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v1

    .line 790
    :goto_1
    return-object v1

    .line 786
    :cond_1
    new-instance v1, Ljava/lang/StringBuilder;

    sget-object v2, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ".jpg"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    .line 790
    :cond_2
    const/4 v1, 0x0

    goto :goto_1
.end method

.method public static readTempJPEGFile(Ljava/lang/String;Landroid/graphics/drawable/Drawable;)Landroid/graphics/Bitmap;
    .locals 3
    .parameter "picname"
    .parameter "def"

    .prologue
    .line 769
    const-string v0, ""

    .line 770
    .local v0, picpath:Ljava/lang/String;
    const-string v1, ".jpg"

    invoke-virtual {p0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 771
    new-instance v1, Ljava/lang/StringBuilder;

    sget-object v2, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 774
    :goto_0
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v1

    if-nez v1, :cond_0

    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMountedReadOnly()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 775
    :cond_0
    invoke-static {v0}, Lcom/netease/newsreader/util/PicUtil;->fitSizeImg(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v1

    .line 777
    .end local p1
    :goto_1
    return-object v1

    .line 772
    .restart local p1
    :cond_1
    new-instance v1, Ljava/lang/StringBuilder;

    sget-object v2, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ".jpg"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    .line 777
    :cond_2
    check-cast p1, Landroid/graphics/drawable/BitmapDrawable;

    .end local p1
    invoke-virtual {p1}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v1

    goto :goto_1
.end method

.method public static resizeBitmap(Landroid/content/Context;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    .locals 12
    .parameter "context"
    .parameter "src"

    .prologue
    const/4 v9, 0x0

    const/4 v1, 0x0

    .line 70
    if-nez p1, :cond_1

    .line 111
    :cond_0
    :goto_0
    return-object v9

    .line 73
    :cond_1
    const/16 v8, 0x28

    .local v8, frameW:I
    const/16 v7, 0x28

    .line 74
    .local v7, frameH:I
    const/4 v11, 0x0

    .line 75
    .local v11, scaleWidth:F
    const/4 v10, 0x0

    .line 76
    .local v10, scaleHeight:F
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v3

    .line 77
    .local v3, w:I
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v4

    .line 78
    .local v4, h:I
    if-eqz v3, :cond_0

    if-eqz v4, :cond_0

    .line 81
    int-to-float v0, v8

    int-to-float v2, v3

    div-float v11, v0, v2

    .line 82
    int-to-float v0, v7

    int-to-float v2, v4

    div-float v10, v0, v2

    .line 84
    new-instance v5, Landroid/graphics/Matrix;

    invoke-direct {v5}, Landroid/graphics/Matrix;-><init>()V

    .line 85
    .local v5, m:Landroid/graphics/Matrix;
    invoke-virtual {v5, v11, v10}, Landroid/graphics/Matrix;->postScale(FF)Z

    .line 87
    const/4 v6, 0x1

    move-object v0, p1

    move v2, v1

    invoke-static/range {v0 .. v6}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;

    move-result-object v9

    .line 105
    .local v9, resizedBitmap:Landroid/graphics/Bitmap;
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Landroid/graphics/Bitmap;->isRecycled()Z

    move-result v0

    if-nez v0, :cond_0

    .line 106
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->recycle()V

    .line 107
    const/4 p1, 0x0

    goto :goto_0
.end method

.method public static resizeBitmap(Landroid/content/Context;Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;
    .locals 10
    .parameter "context"
    .parameter "src"
    .parameter "frameW"
    .parameter "frameH"

    .prologue
    const/4 v7, 0x0

    const/4 v1, 0x0

    .line 191
    if-nez p1, :cond_1

    .line 231
    :cond_0
    :goto_0
    return-object v7

    .line 195
    :cond_1
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v3

    .line 196
    .local v3, w:I
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v4

    .line 197
    .local v4, h:I
    if-eqz v3, :cond_0

    if-eqz v4, :cond_0

    .line 200
    if-ne v3, p2, :cond_2

    if-ne v4, p3, :cond_2

    move-object v7, p1

    .line 201
    goto :goto_0

    .line 203
    :cond_2
    int-to-float v0, p2

    int-to-float v2, v3

    div-float v9, v0, v2

    .line 204
    .local v9, scaleWidth:F
    int-to-float v0, p3

    int-to-float v2, v4

    div-float v8, v0, v2

    .line 206
    .local v8, scaleHeight:F
    new-instance v5, Landroid/graphics/Matrix;

    invoke-direct {v5}, Landroid/graphics/Matrix;-><init>()V

    .line 207
    .local v5, matrix:Landroid/graphics/Matrix;
    invoke-virtual {v5, v9, v8}, Landroid/graphics/Matrix;->postScale(FF)Z

    .line 209
    const/4 v6, 0x1

    move-object v0, p1

    move v2, v1

    invoke-static/range {v0 .. v6}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;

    move-result-object v7

    .line 226
    .local v7, resizedBitmap:Landroid/graphics/Bitmap;
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Landroid/graphics/Bitmap;->isRecycled()Z

    move-result v0

    if-nez v0, :cond_0

    .line 227
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->recycle()V

    .line 228
    const/4 p1, 0x0

    goto :goto_0
.end method

.method public static resizeBitmap4DetailPage(Landroid/content/Context;Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;
    .locals 12
    .parameter "context"
    .parameter "src"
    .parameter "frameW"
    .parameter "frameH"

    .prologue
    const/4 v8, 0x0

    const/16 v11, 0x64

    const/4 v1, 0x0

    .line 125
    if-nez p1, :cond_1

    .line 156
    :cond_0
    :goto_0
    return-object v8

    .line 129
    :cond_1
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v3

    .line 130
    .local v3, w:I
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v4

    .line 131
    .local v4, h:I
    if-eqz v3, :cond_0

    if-eqz v4, :cond_0

    .line 134
    if-ne v3, p2, :cond_2

    if-ne v4, p3, :cond_2

    move-object v8, p1

    .line 135
    goto :goto_0

    .line 137
    :cond_2
    int-to-float v0, p2

    int-to-float v2, v3

    div-float v10, v0, v2

    .line 138
    .local v10, scaleWidth:F
    int-to-float v0, p3

    int-to-float v2, v4

    div-float v9, v0, v2

    .line 140
    .local v9, scaleHeight:F
    new-instance v5, Landroid/graphics/Matrix;

    invoke-direct {v5}, Landroid/graphics/Matrix;-><init>()V

    .line 141
    .local v5, matrix:Landroid/graphics/Matrix;
    invoke-virtual {v5, v10, v9}, Landroid/graphics/Matrix;->postScale(FF)Z

    .line 143
    const/4 v6, 0x1

    move-object v0, p1

    move v2, v1

    invoke-static/range {v0 .. v6}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;

    move-result-object v7

    .line 145
    .local v7, resizedBitmap:Landroid/graphics/Bitmap;
    invoke-static {v7, v11, v11}, Lcom/netease/newsreader/util/PicUtil;->cutBitmap4DetailPage(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;

    move-result-object v8

    .line 147
    .local v8, result:Landroid/graphics/Bitmap;
    invoke-virtual {v8, v7}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_3

    invoke-virtual {v7}, Landroid/graphics/Bitmap;->isRecycled()Z

    move-result v0

    if-nez v0, :cond_3

    .line 148
    invoke-virtual {v7}, Landroid/graphics/Bitmap;->recycle()V

    .line 149
    const/4 v7, 0x0

    .line 152
    :cond_3
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Landroid/graphics/Bitmap;->isRecycled()Z

    move-result v0

    if-nez v0, :cond_0

    .line 153
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->recycle()V

    .line 154
    const/4 p1, 0x0

    goto :goto_0
.end method

.method public static saveMyBitmap(Ljava/lang/String;Landroid/graphics/Bitmap;)Z
    .locals 7
    .parameter "filename"
    .parameter "mBitmap"

    .prologue
    const/4 v4, 0x0

    .line 540
    if-nez p1, :cond_1

    .line 573
    :cond_0
    :goto_0
    return v4

    .line 542
    :cond_1
    const-string v3, ""

    .line 544
    .local v3, returnfilename:Ljava/lang/String;
    const-string v5, ".jpg"

    invoke-virtual {p0, v5}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-eqz v5, :cond_3

    .line 545
    new-instance v5, Ljava/lang/StringBuilder;

    sget-object v6, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v6}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v5, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    .line 551
    :goto_1
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 552
    invoke-static {}, Lcom/netease/newsreader/util/PicUtil;->createPhotoTempFolder()Z

    .line 554
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 556
    .local v1, f:Ljava/io/File;
    :try_start_0
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v5

    if-eqz v5, :cond_2

    invoke-virtual {v1}, Ljava/io/File;->delete()Z

    .line 557
    :cond_2
    invoke-virtual {v1}, Ljava/io/File;->createNewFile()Z

    .line 558
    const/4 v2, 0x0

    .line 559
    .local v2, fOut:Ljava/io/FileOutputStream;
    new-instance v2, Ljava/io/FileOutputStream;

    .end local v2           #fOut:Ljava/io/FileOutputStream;
    invoke-direct {v2, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 561
    .restart local v2       #fOut:Ljava/io/FileOutputStream;
    sget-object v5, Landroid/graphics/Bitmap$CompressFormat;->PNG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v6, 0x50

    invoke-virtual {p1, v5, v6, v2}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    .line 563
    invoke-virtual {v2}, Ljava/io/FileOutputStream;->flush()V

    .line 564
    invoke-virtual {v2}, Ljava/io/FileOutputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 571
    const/4 v4, 0x1

    goto :goto_0

    .line 547
    .end local v1           #f:Ljava/io/File;
    .end local v2           #fOut:Ljava/io/FileOutputStream;
    :cond_3
    new-instance v5, Ljava/lang/StringBuilder;

    sget-object v6, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v6}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v5, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, ".jpg"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    goto :goto_1

    .line 566
    .restart local v1       #f:Ljava/io/File;
    :catch_0
    move-exception v0

    .line 568
    .local v0, e:Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method public static saveMyBitmap(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Bitmap;)Z
    .locals 8
    .parameter "path"
    .parameter "filename"
    .parameter "mBitmap"

    .prologue
    const/4 v5, 0x0

    .line 579
    const-string v4, ""

    .line 581
    .local v4, returnfilename:Ljava/lang/String;
    const-string v6, ".jpg"

    invoke-virtual {p1, v6}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v6

    if-eqz v6, :cond_3

    .line 582
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    .line 586
    :goto_0
    new-instance v3, Ljava/io/File;

    invoke-direct {v3, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 588
    .local v3, file:Ljava/io/File;
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v6

    if-eqz v6, :cond_2

    .line 589
    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v6

    if-nez v6, :cond_0

    .line 590
    invoke-virtual {v3}, Ljava/io/File;->mkdirs()Z

    .line 593
    :cond_0
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 595
    .local v1, f:Ljava/io/File;
    :try_start_0
    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v6

    if-eqz v6, :cond_1

    invoke-virtual {v1}, Ljava/io/File;->delete()Z

    .line 596
    :cond_1
    invoke-virtual {v1}, Ljava/io/File;->createNewFile()Z

    .line 597
    const/4 v2, 0x0

    .line 598
    .local v2, fOut:Ljava/io/FileOutputStream;
    new-instance v2, Ljava/io/FileOutputStream;

    .end local v2           #fOut:Ljava/io/FileOutputStream;
    invoke-direct {v2, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 600
    .restart local v2       #fOut:Ljava/io/FileOutputStream;
    sget-object v6, Landroid/graphics/Bitmap$CompressFormat;->PNG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v7, 0x50

    invoke-virtual {p2, v6, v7, v2}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    .line 602
    invoke-virtual {v2}, Ljava/io/FileOutputStream;->flush()V

    .line 603
    invoke-virtual {v2}, Ljava/io/FileOutputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/OutOfMemoryError; {:try_start_0 .. :try_end_0} :catch_1

    .line 614
    const/4 v5, 0x1

    .line 615
    .end local v1           #f:Ljava/io/File;
    .end local v2           #fOut:Ljava/io/FileOutputStream;
    :cond_2
    :goto_1
    return v5

    .line 584
    .end local v3           #file:Ljava/io/File;
    :cond_3
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, ".jpg"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    goto :goto_0

    .line 606
    .restart local v1       #f:Ljava/io/File;
    .restart local v3       #file:Ljava/io/File;
    :catch_0
    move-exception v0

    .line 608
    .local v0, e:Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1

    .line 610
    .end local v0           #e:Ljava/lang/Exception;
    :catch_1
    move-exception v0

    .line 611
    .local v0, e:Ljava/lang/OutOfMemoryError;
    invoke-virtual {v0}, Ljava/lang/OutOfMemoryError;->printStackTrace()V

    goto :goto_1
.end method

.method public static writeLocalJPEGFile(Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Ljava/lang/String;
    .locals 10
    .parameter "path"
    .parameter "is"
    .parameter "filename"

    .prologue
    const/4 v9, -0x1

    .line 636
    const-string v6, ""

    .line 638
    .local v6, returnfilename:Ljava/lang/String;
    const-string v7, ".jpg"

    invoke-virtual {p2, v7}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v7

    if-eqz v7, :cond_1

    .line 639
    new-instance v7, Ljava/lang/StringBuilder;

    invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v8

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v7, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    .line 643
    :goto_0
    new-instance v2, Ljava/io/File;

    invoke-direct {v2, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 646
    .local v2, file:Ljava/io/File;
    :try_start_0
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v7

    if-eqz v7, :cond_7

    .line 647
    invoke-virtual {v2}, Ljava/io/File;->exists()Z

    move-result v7

    if-nez v7, :cond_4

    .line 648
    invoke-virtual {v2}, Ljava/io/File;->mkdirs()Z

    move-result v7

    if-eqz v7, :cond_3

    .line 650
    new-instance v5, Ljava/io/File;

    invoke-direct {v5, v6}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 652
    .local v5, picfile:Ljava/io/File;
    invoke-virtual {v5}, Ljava/io/File;->exists()Z

    move-result v7

    if-nez v7, :cond_0

    .line 653
    invoke-virtual {v5}, Ljava/io/File;->createNewFile()Z

    .line 655
    :cond_0
    new-instance v3, Ljava/io/FileOutputStream;

    invoke-direct {v3, v5}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 656
    .local v3, fouts:Ljava/io/FileOutputStream;
    const/16 v7, 0x400

    new-array v0, v7, [B

    .line 657
    .local v0, b:[B
    const/4 v4, -0x1

    .line 658
    .local v4, i:I
    :goto_1
    invoke-virtual {p1, v0}, Ljava/io/InputStream;->read([B)I

    move-result v4

    if-ne v4, v9, :cond_2

    .line 662
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->flush()V

    .line 663
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->close()V

    .line 664
    invoke-virtual {p1}, Ljava/io/InputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 695
    .end local v0           #b:[B
    .end local v3           #fouts:Ljava/io/FileOutputStream;
    .end local v4           #i:I
    .end local v5           #picfile:Ljava/io/File;
    :goto_2
    return-object v6

    .line 641
    .end local v2           #file:Ljava/io/File;
    :cond_1
    new-instance v7, Ljava/lang/StringBuilder;

    invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v8

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v7, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, ".jpg"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    goto :goto_0

    .line 660
    .restart local v0       #b:[B
    .restart local v2       #file:Ljava/io/File;
    .restart local v3       #fouts:Ljava/io/FileOutputStream;
    .restart local v4       #i:I
    .restart local v5       #picfile:Ljava/io/File;
    :cond_2
    const/4 v7, 0x0

    :try_start_1
    invoke-virtual {v3, v0, v7, v4}, Ljava/io/FileOutputStream;->write([BII)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1

    .line 690
    .end local v0           #b:[B
    .end local v3           #fouts:Ljava/io/FileOutputStream;
    .end local v4           #i:I
    .end local v5           #picfile:Ljava/io/File;
    :catch_0
    move-exception v1

    .line 692
    .local v1, e:Ljava/lang/Exception;
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    .line 693
    const-string v6, ""

    goto :goto_2

    .line 668
    .end local v1           #e:Ljava/lang/Exception;
    :cond_3
    :try_start_2
    const-string v6, ""

    goto :goto_2

    .line 671
    :cond_4
    new-instance v5, Ljava/io/File;

    invoke-direct {v5, v6}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 673
    .restart local v5       #picfile:Ljava/io/File;
    invoke-virtual {v5}, Ljava/io/File;->exists()Z

    move-result v7

    if-nez v7, :cond_5

    .line 674
    invoke-virtual {v5}, Ljava/io/File;->createNewFile()Z

    .line 676
    :cond_5
    new-instance v3, Ljava/io/FileOutputStream;

    invoke-direct {v3, v5}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 677
    .restart local v3       #fouts:Ljava/io/FileOutputStream;
    const/16 v7, 0x400

    new-array v0, v7, [B

    .line 678
    .restart local v0       #b:[B
    const/4 v4, -0x1

    .line 679
    .restart local v4       #i:I
    :goto_3
    invoke-virtual {p1, v0}, Ljava/io/InputStream;->read([B)I

    move-result v4

    if-ne v4, v9, :cond_6

    .line 683
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->flush()V

    .line 684
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->close()V

    .line 685
    invoke-virtual {p1}, Ljava/io/InputStream;->close()V

    goto :goto_2

    .line 681
    :cond_6
    const/4 v7, 0x0

    invoke-virtual {v3, v0, v7, v4}, Ljava/io/FileOutputStream;->write([BII)V

    goto :goto_3

    .line 688
    .end local v0           #b:[B
    .end local v3           #fouts:Ljava/io/FileOutputStream;
    .end local v4           #i:I
    .end local v5           #picfile:Ljava/io/File;
    :cond_7
    const-string v6, ""
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_2
.end method

.method public static writeTempJPEGFile(Ljava/io/InputStream;Ljava/lang/String;)Ljava/lang/String;
    .locals 10
    .parameter "is"
    .parameter "filename"

    .prologue
    const/4 v9, -0x1

    .line 701
    const-string v6, ""

    .line 703
    .local v6, returnfilename:Ljava/lang/String;
    const-string v7, ".jpg"

    invoke-virtual {p1, v7}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v7

    if-eqz v7, :cond_1

    .line 704
    new-instance v7, Ljava/lang/StringBuilder;

    sget-object v8, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v8}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v8

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v7, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    .line 708
    :goto_0
    new-instance v2, Ljava/io/File;

    sget-object v7, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-direct {v2, v7}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 711
    .local v2, file:Ljava/io/File;
    :try_start_0
    invoke-static {}, Lcom/netease/newsreader/util/FileUtils;->isSDCardMounted()Z

    move-result v7

    if-eqz v7, :cond_7

    .line 712
    invoke-virtual {v2}, Ljava/io/File;->exists()Z

    move-result v7

    if-nez v7, :cond_4

    .line 713
    invoke-static {}, Lcom/netease/newsreader/util/PicUtil;->createPhotoTempFolder()Z

    move-result v7

    if-eqz v7, :cond_3

    .line 715
    new-instance v5, Ljava/io/File;

    invoke-direct {v5, v6}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 717
    .local v5, picfile:Ljava/io/File;
    invoke-virtual {v5}, Ljava/io/File;->exists()Z

    move-result v7

    if-nez v7, :cond_0

    .line 718
    invoke-virtual {v5}, Ljava/io/File;->createNewFile()Z

    .line 720
    :cond_0
    new-instance v3, Ljava/io/FileOutputStream;

    invoke-direct {v3, v5}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 721
    .local v3, fouts:Ljava/io/FileOutputStream;
    const/16 v7, 0x400

    new-array v0, v7, [B

    .line 722
    .local v0, b:[B
    const/4 v4, -0x1

    .line 723
    .local v4, i:I
    :goto_1
    invoke-virtual {p0, v0}, Ljava/io/InputStream;->read([B)I

    move-result v4

    if-ne v4, v9, :cond_2

    .line 727
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->flush()V

    .line 728
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->close()V

    .line 729
    invoke-virtual {p0}, Ljava/io/InputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 759
    .end local v0           #b:[B
    .end local v3           #fouts:Ljava/io/FileOutputStream;
    .end local v4           #i:I
    .end local v5           #picfile:Ljava/io/File;
    :goto_2
    return-object v6

    .line 706
    .end local v2           #file:Ljava/io/File;
    :cond_1
    new-instance v7, Ljava/lang/StringBuilder;

    sget-object v8, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v8}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v8

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v7, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, ".jpg"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    goto :goto_0

    .line 725
    .restart local v0       #b:[B
    .restart local v2       #file:Ljava/io/File;
    .restart local v3       #fouts:Ljava/io/FileOutputStream;
    .restart local v4       #i:I
    .restart local v5       #picfile:Ljava/io/File;
    :cond_2
    const/4 v7, 0x0

    :try_start_1
    invoke-virtual {v3, v0, v7, v4}, Ljava/io/FileOutputStream;->write([BII)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1

    .line 755
    .end local v0           #b:[B
    .end local v3           #fouts:Ljava/io/FileOutputStream;
    .end local v4           #i:I
    .end local v5           #picfile:Ljava/io/File;
    :catch_0
    move-exception v1

    .line 756
    .local v1, e:Ljava/lang/Exception;
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    .line 757
    const-string v6, ""

    goto :goto_2

    .line 733
    .end local v1           #e:Ljava/lang/Exception;
    :cond_3
    :try_start_2
    const-string v6, ""

    goto :goto_2

    .line 736
    :cond_4
    new-instance v5, Ljava/io/File;

    invoke-direct {v5, v6}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 738
    .restart local v5       #picfile:Ljava/io/File;
    invoke-virtual {v5}, Ljava/io/File;->exists()Z

    move-result v7

    if-nez v7, :cond_5

    .line 739
    invoke-virtual {v5}, Ljava/io/File;->createNewFile()Z

    .line 741
    :cond_5
    new-instance v3, Ljava/io/FileOutputStream;

    invoke-direct {v3, v5}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 742
    .restart local v3       #fouts:Ljava/io/FileOutputStream;
    const/16 v7, 0x400

    new-array v0, v7, [B

    .line 743
    .restart local v0       #b:[B
    const/4 v4, -0x1

    .line 744
    .restart local v4       #i:I
    :goto_3
    invoke-virtual {p0, v0}, Ljava/io/InputStream;->read([B)I

    move-result v4

    if-ne v4, v9, :cond_6

    .line 748
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->flush()V

    .line 749
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->close()V

    .line 750
    invoke-virtual {p0}, Ljava/io/InputStream;->close()V

    goto :goto_2

    .line 746
    :cond_6
    const/4 v7, 0x0

    invoke-virtual {v3, v0, v7, v4}, Ljava/io/FileOutputStream;->write([BII)V

    goto :goto_3

    .line 753
    .end local v0           #b:[B
    .end local v3           #fouts:Ljava/io/FileOutputStream;
    .end local v4           #i:I
    .end local v5           #picfile:Ljava/io/File;
    :cond_7
    const-string v6, ""
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_2
.end method
